package com.li.controller;

import com.github.pagehelper.PageInfo;
import com.li.mapper.TransferMapper;
import com.li.pojo.dto.TransferDTO;
import com.li.pojo.po.PageResult;
import com.li.pojo.po.Result;

import com.li.service.TransferService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/transfer")
public class TransferController {

    @Autowired
    private TransferService transferService;

    /**
     * 转派分页
     * @param transferDTO
     * @return
     */
    @GetMapping("/list")
    public PageResult page(TransferDTO transferDTO) {
        PageResult pageResult = transferService.page(transferDTO);
        return pageResult;
    }

    @PutMapping("/assignment/{type}/{userId}/{transferUserId}")
    public Result assignment(@PathVariable Integer transferUserId, @PathVariable String type, @PathVariable Integer userId ){
        transferService.assignment(transferUserId,type,userId);
        return new Result(200,"操作成功","");
    }

}
